package com.yeban.javase.day12.test.streamtest;

import java.util.Arrays;
import java.util.stream.Collectors;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/10/22
 *
 * 7.计算Integer集合中大于6的元素的个数
 */
public class StreamTest07 {

    public static void main(String[] args) {
        Integer[] nums = {3,7,9,1,5,10,4,8,14};
        // count()  终结方法    返回值是long
        long n1 = Arrays.asList(nums).stream().filter(s -> s > 6).count();
        int n = (int)Arrays.asList(nums).stream().filter(s -> s > 6).count();
        System.out.println(n);

    }
}
